/*
 * Copyright 2009 Eat Local Food, LLC
 *
 * This file is part of gwtCommerce.
 *
 * gwtCommerce is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * gwtCommerce is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with gwtCommerce.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.elf.gwt.common.client.subcomponent;

import com.elf.gwt.common.client.callback.SubComponentCallback;
import com.google.gwt.user.client.ui.FlowPanel;

/**
 *  Provides for common behavior of subcomponents.
 */
public class CommonSubComponent extends FlowPanel
{
	/** master controller for application **/
	/** handle for the subclass used in css and resource finding **/
	protected String handle;
	/** property used to grab this instance in listeners **/
	protected CommonSubComponent thisComponent;
	/** action that the main Component is set to **/
	protected String superAction;
	protected SubComponentCallback callback;

	/**
	 * Constructor
	 */
	public CommonSubComponent(String handle, String superAction, SubComponentCallback callback)
	{
		this.superAction = superAction;
		this.setStyleName(handle + "SubComponent");
		
		thisComponent = this;
		this.handle = handle;
		this.callback = callback;
	}
	
	public void build()
	{
	}

	public String getHandle()
	{
		return handle;
	}

	public String getSuperAction() {
		return superAction;
	}

	public void setSuperAction(String superAction) {
		this.superAction = superAction;
	}

	public SubComponentCallback getCallback() {
		return callback;
	}
}
